const mysql = require("mysql");

let pool = mysql.createPool({
    host: "localhost",
    user: "root",
    password: "12345678",
    database: "test"
})

function excute(sqlString, condition) {
    let result = new Promise((resolve, reject) => {
        pool.query(sqlString, condition, function (error, result, fields) {
            if (error) {
                reject(error);
            }
            else {
                resolve(result);
            }
        })
    })
    return result;
}

module.exports = {
    EXCUTE: excute
}